package cn.bdqn.seventh;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @Description TODO
 * @Date 2020/2/12 11:37
 * @Created by 张三三
 */
@Lazy
@Scope("prototype")
@Component
public class Car {
    @Value("奥迪")
    private String brand;

    private double price;

    public Car() {
        System.out.println("Car 对象已经创建!!!");
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Car{" +
                "brand='" + brand + '\'' +
                ", price=" + price +
                '}';
    }
}
